package com.example.famhealing.schedule;

import com.example.famhealing.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;

public class SetRatePressure extends Activity implements OnClickListener{
	
	ImageButton ratePlus;
	ImageButton rateMinus;
	ImageButton pressurePlus;
	ImageButton pressureMinus;
	EditText rateET;
	EditText pressureET;
	
	public static int tempRate = 80;
	public static int tempPressure = 100;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_ratepressure);
          
          ratePlus = (ImageButton)findViewById(R.id.ratePlus);
          rateMinus = (ImageButton)findViewById(R.id.rateMinus);
          pressurePlus = (ImageButton)findViewById(R.id.pressurePlus);
          pressureMinus = (ImageButton)findViewById(R.id.pressureMinus);
          
          ratePlus.setOnClickListener(this);
          rateMinus.setOnClickListener(this);
          pressurePlus.setOnClickListener(this);
          pressureMinus.setOnClickListener(this);
          
          rateET = (EditText)findViewById(R.id.rate);
          pressureET = (EditText)findViewById(R.id.pressure);
         
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()) {
		case R.id.ratePlus :
			rateET.setText(Integer.toString(tempRate+1));
			tempRate = tempRate + 1;
			break;
		case R.id.rateMinus :
			rateET.setText(Integer.toString(tempRate-1));
			tempRate = tempRate - 1;
			break;
		case R.id.pressurePlus :
			pressureET.setText(Integer.toString(tempPressure+1));
			tempPressure = tempPressure + 1;
			break;
		case R.id.pressureMinus :
			pressureET.setText(Double.toString(tempPressure-1));
			tempPressure = tempPressure - 1;
			break;
		}
		
	}
	
	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
    }


}
